home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
presto
/
presto10.lha
/
makelinks
< prev
next >
Wrap
Text File
|
1991-12-11
|
2KB
|
89 lines
#! /bin/sh
# This script sets up whole directories of symbolic links
# so that we can build target-specific versions of Presto.
CCSUFFIX=C # suffix used for C++ files
usage="<target>"
if [ $# -lt 1 ] ; then
echo "usage: `basename $0` $usage"
exit 1
fi
if [ ! -f src/Makefile.$1 ] ; then
echo "no makefile for target \"$1\""
exit 1
fi
if [ -f $1/Base/presto.h -o -f $1/presto.h ] ; then
echo links already created - use \"rmlinks $1\" to remove
exit 0
fi
mkdir $1 $1/Base $1/Base_debug $1/test > /dev/null 2>&1
topdir=`pwd`
# Now go into the source directory, and create all
# the links.
echo linking Makefile ...
ln -s $topdir/src/Makefile.$1 $1/Makefile
cd src
here=`pwd`
echo creating source file links ...
for file in *.$CCSUFFIX *.c *.h *.s
do
ln -s $here/$file ../$1/$file
# On the sequent, these two are not necessary
# because make(1) supports the VPATH search variable.
# Other platforms get 3 symbolic links per source file. Yuk.
if [ "$1" != "sequent" ] ; then
ln -s $here/$file ../$1/Base/$file
ln -s $here/$file ../$1/Base_debug/$file
fi
done
# however, on a Sequent, we do need access from cpp to the asmdefs.h
# file, from each of the Base and Base_debug dirs. This file gets
# prepended to cfront's output before /bin/cc gets it. cpp can't find
# it since it doesn't know about VPATH, like make does.
if [ "$1" = "sequent" ] ; then
ln -s $here/asmdefs.h ../$1/Base
ln -s $here/asmdefs.h ../$1/Base_debug
fi
# Now go to the test directory, and link all these files
# into the target.
if [ "$1" = mips ] ; then
TESTS="exer fork burner"
else
TESTS="exer sos fork burner barrier"
fi
# Now copy all the test programs over
cd ../Tests
here=`pwd`
ln -s $here/Makefile.$1 ../$1/test/Makefile
ln -s $here/make.h.$1 ../$1/test/make.h
ln -s $here/runtests.$1 ../$1/test/runtests
for test in $TESTS
do
echo creating links for test \"$test\" ...
mkdir ../$1/test/$test >/dev/null 2>&1
ln -s $here/$test/*.C ../$1/test/$test
ln -s $here/$test/*.h ../$1/test/$test
ln -s $here/$test/Makefile ../$1/test/$test
ln -s $here/$test/runtests $test/README ../$1/test/$test
done
exit 0